package main

import "fmt"

func main(){

	defer func(){

		fmt.Println("defer func is called")

		if err := recover(); err != nil {
			// err 就是 panic happened
			fmt.Println(err)
		}
	}()

	fmt.Println("logic 1")

	panic("panic happened!")

	fmt.Println("logic 2")
}